package com.zwb.demo.easyweb.modules.database.controller;

import com.zwb.demo.easyweb.common.entity.response.ResponseResult;
import com.zwb.demo.easyweb.modules.database.service.DatabaseColumnService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(value = "数据库列接口" ,description = "数据库列接口")
public class DatabaseColumnController {


    private final DatabaseColumnService databaseColumnService;

    @Autowired
    public DatabaseColumnController(DatabaseColumnService databaseColumnService) {
        this.databaseColumnService = databaseColumnService;
    }

    @GetMapping("/database/table/{uuid}/column")
    @ApiOperation(value = "通过数据库表id查询所有列")
    public ResponseResult findAllColumnByTableId(@PathVariable String uuid){
        return databaseColumnService.findAllColumnByTableId(uuid);
    }
}
